home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
DJEMU106.ARJ
/
FAQ
< prev
next >
Wrap
Text File
|
1992-04-13
|
7KB
|
128 lines
Q: When I run "gcc e:\proj\prog.c" it says "undefined escape sequence \p"?
A: Gcc is a *unix* compiler - you must use *unix* slashes (e:/proj/prog.c).
Environment variables (like GCCINC) may, however, use either, as they
are converted.
Q: I type "GCC PROG.C" and ld complains about PROG.C not being an object.
Q: I type "gcc prog.cxx" to compile a C++ program, and ld complains.
A: Gcc is *not* case insensitive like DOS is, and it uses the file's
extension to determine how to compile a file. Valid extensions are:
.cc = C++ source (passed through cpp)
.c = C source that must be passed through cpp first
.i = raw C source (no cpp pass)
.S = assembler that must be passed through cpp first
.s = raw assembler source (no cpp pass)
any other file is passed to the linker
Q: I compile my program, but can't run the output file.
A: DOS doesn't know how to run unix-style a.out files. That's what the
extender is for. To run an a.out file called myprog, type
"go32 myprog . . ."
Q: Gcc doesn't recognize // as a comment in my C programs.
A: That's because // isn't a comment in C. If you want to compile C++,
then write C++ programs. Gcc is really two compilers in one, not
one compiler that compiles both C and C++. That's why you get
cc1 and cc1plus.
Q: I'm reading in data files, but the data gets corrupted.
A: The default file type is DOS text, even for read() and write(). You must
tell the system that a file is binary through the "b" flag in fopen(),
or O_BINARY in open().
Q: I get "fatal signal 2" when I run gcc.
A: When gcc reports a "signal", it really means that an error occurred
trying to run the given program. The "signal" number is the DOS error
code, and 2 means "file not found". Check the COMPILER_PATH environment
variable and make sure it points to the directory with cpp.exe,
cc1.exe, etc.
Q: The binaries I get with the distribution are .exe files, but gcc creates
a.out files. I rename the a.out's to .EXE's, but they still don't work.
A: To get an .EXE from an a.out, you must *prepend* either go32.exe,
debug32.exe, or stub.exe to the file. A program called "aout2exe"
is provided to do this. Just run "aout2exe myprog".
Q: What is stub.exe?
A: Stub.exe simply calles go32.exe, and passes it information it needs to
run the a.out file attached to it. Stub is much smaller than go32, so
less disk space is used. Also, if you change go32, you don't have to
change stub, and all the stub-ized programs will use the new go32
automatically.
Q: I want to change cc1. How do I do this?
A: First, get the GNU sources from FSF. They're usually available at
prep.ai.mit.edu in /u/emacs, if not elsewhere. Use djtarx to un-tar
them, as djtarx knows how to handle unix file names that aren't valid
DOS file names. Look in the "diffs" sources to see what to change the
names to when they conflict. Next, apply the "diffs" (if any) over the
GNU sources (making sure you have the right version of GNU - see the
versions file). For gcc 2.0 and above, you must run "configure go32"
to prepare the sources for a native go32 compiler before building.
For all other programs, just run make. Note that the makefiles
are tuned for ndmake, since it knows how to make response files.
Specific instructions are documented in the diffs directory.
Q: I don't have an 80387. How do I compile floating point programs?
A: Add "emu c:\djgpp\emu387\emu387" to the GO32 environment variable
(see go32 section in readme). This tells go32 to use the given file
as an 80387 emulator. If you don't load this emulator, and you try
to run floating point without a 387, you will get an error.
Q: I installed an 80387 emulator in my AUTOEXEC, but it still doesn't
work. Why?
A: The CPU is running in *protected* mode, not real mode, and the information
needed to emulate the 80387 is different. Not to mention that the
exceptions never get to the real-mode handler. You must use the emu387
emulator, which is designed for go32.
Q: I can't run a.out programs under Windows.
A: Nope, you can't. Go32 only supports VCPI, and Windows provides
DPMI 0.9, which isn't enough for Go32 to work correctly.
Q: Can I run this on my 286? It has protected mode also...
A: True, but the 286 isn't a 32-bit processor. A 386 really is required.
Q: Can I use gcc on my 512K machine?
A: Yes, but the disk better have at least 4Mb of free space for paging.
Go32 will use all available extended memory (up to 128M) and up to
128M of disk space, for a grand total of 256M of virtual memory for
your application. Try a malloc(50*1024*1024) some day.
Q: Why do my compiles are running VERY SLOW, even though I use a ramdisk
for swap and a disk cache?
A: Gcc requires at least 1Mb of virtual memory to run, usually close to 1.5M.
If there isn't this much real memory available, it starts paging to disk.
It's good to leave about 1M of extended (not expanded) memory available
for go32 to run programs with. When it needs to page a lot, you spend
most of your time paging and little time actually running. Note that
if you are running with a VCPI server, like QEMM or 386MAX, then go32
will use *expanded* memory for it's physical memory needs, not
extended.
Q: How much memory is available when I use the system() call?
A: Everything but what go32 is loaded with. The program is completely
paged out to memory (including the page tables themselves) before
the second program is executed. Currently, this is about 100K
less than was available before go32 was executed.
Q: Go32 complains that the CPU must be in V86 mode to run.
A: When the CPU is in V86 mode, the V86 manager must provide VCPI
services for go32. Since VCPI is an extension to EMS, disabling EMS
will disable VCPI, and prevent go32 from running. For emm386.sys, this
means that you can't use the "noems" switch.
Q: How do globbing and response files work?
A: A response file is a file that contains stuff that goes on the command
line, but is too big for DOS. The name of the file is given as "@file"
to any a.out program, and go32 reads the file for command line
information. It uses single and double quotes to group parameters, and
backslashes to escape quotes, spaces, tabs, newlines, and backslashes.
Parameters containing wildcards are expanded if they can be, else they
are unmodified. Surrounding a parameter in single quotes will prevent
wildcards from being expanded. This is similar to unix. Note that
backslashes are not special if they are not in front of a quote,
whitespace, or backslash.